
var barName= ['1号','2号','3号'];
var quanwang_barName=['实际波动量','预测波动量'];
var analysis_vm=new Vue({
    el:'#analysis',
    filters:{
        formatterTime:function(val){
            var oDate=new Date(val);
            var year=oDate.getFullYear();
            var month=oDate.getMonth()+1;
            var date=oDate.getDate();
            var hour=oDate.getHours();
            var minute=oDate.getMinutes();
            return year+'年'+toDou(month)+'月'+toDou(date)+'日  '+toDou(hour)+':'+toDou(minute);
        },
        toStr:function(val){
            return toString(val)
        }

    },
    data:{
        sectionTime:{},
        sectionTimeBoiler:{},
        date:{},
        viewChart:{
            chartArr:[],
            chartId:['chart_'+uuid(6,64),'chart_'+uuid(6,64),'chart_'+uuid(6,64),'chart_'+uuid(6,64),'chart_'+uuid(6,64)],
            chartName:[
                [],
                [],
                ['gaolu345','gaolu12'],
                ['fangsan'],
                []
            ],
            chartData:[
                [
                    {name:'压力稳定率',type:'line',lineStyle:'solid',stack:'总量',areaStyle: {normal: {}}},
                    {name:'超上限率',type:'line',lineStyle:'solid',stack:'总量', areaStyle: {normal: {}}},
                    {name:'超下限率',type:'line',lineStyle:'solid',stack:'总量', areaStyle: {normal: {}}}
                ],
                [
                    {name:'1号',type:'line',lineStyle:'solid',color:'#01c5f7'},
                    {name:'2号',type:'line',lineStyle:'solid', color:'#8c04c6'},
                    {name:'3号',type:'line',lineStyle:'solid', color:'#6822e4'},
                    {name:'4号',type:'line',lineStyle:'solid',color:'#e8830d'},
                    {name:'5号',type:'line',lineStyle:'solid',color:'#87c313'}

                ],
                [
                    {name:'高炉345',type:'line',lineStyle:'solid'},
                    {name:'高炉12',type:'line',lineStyle:'solid'}
                ],
                [
                    {name:'平均放散开度',type:'line',lineStyle:'solid'}
                ],
                [
                    {name:'轧钢停线重叠率',type:'line',lineStyle:'solid'}
                ]
            ],
            chartOption:[
                {

                    legend:{
                        show:true,
                        textStyle:{
                            color:'#afeafb'
                        },
                        right:0,
                        data:[
                            {
                                name:'压力稳定率',
                                icon:'rect'
                            },{
                                name:'超上限率',
                                icon:'rect'
                            },{
                                name:'超下限率',
                                icon:'rect'
                            }]
                    },
                    tooltip:{
                        show:true,
                        alwaysShowContent:false,
                        formatter:function(params){
                            var nameArr = [];
                            var valueArr = [];
                            var str = '';
                            for(var i=0;i<params.length;i++){
                                nameArr[i]=params[i].seriesName;
                                valueArr[i]=Number(params[i].data).toFixed(1);

                                str+= nameArr[i]+' : '+valueArr[i]+'<br/>'
                            }
                            return params[0].axisValueLabel+'<br/>'+str
                        }
                    },
                    yAxis:{
                        name:'(%)'
                    },
                    color:['#00cdfd','#8806c5','#6925e5']
                },
                {
                    tooltip:{
                        show:true,
                        alwaysShowContent:false,
                        formatter:function(params){
                            var nameArr = [];
                            var valueArr = [];
                            var str = '';
                            for(var i=0;i<params.length;i++){
                                nameArr[i]=params[i].seriesName;
                                valueArr[i]=Number(params[i].data).toFixed(1);

                                str+= nameArr[i]+' : '+valueArr[i]+'<br/>'
                            }
                            return params[0].axisValueLabel+'<br/>'+str
                        }
                    },
                    legend:{
                        show:true,
                        textStyle:{
                            color:'#afeafb'
                        },
                        right:0,
                        data:[
                            {
                                name:'1号',
                                icon:'rect'
                            },{
                                name:'2号',
                                icon:'rect'
                            },{
                                name:'3号',
                                icon:'rect'
                            },{
                                name:'4号',
                                icon:'rect'
                            },{
                                name:'5号',
                                icon:'rect'
                            }]
                    },
                    yAxis:{
                        name:'(%)'
                    },
                    color:['#00cdfd','#8806c5','#6925e5']
                },
                {
                    legend:{
                        show:true,
                        textStyle:{
                            color:'#afeafb'
                        },
                        right:0,
                        data:[
                            {
                                name:'高炉345',
                                icon:'rect'
                            },{
                                name:'高炉12',
                                icon:'rect'
                            }]
                    },
                    yAxis:{
                        name:'(%)',
                        axisLabel:{
                            formatter:function (value, index) {
                                return value;
                            }
                        }
                    },
                    tooltip:{
                        alwaysShowContent:false,
                        formatter:function(params){
                            var nameArr = [];
                            var valueArr = [];
                            var str = '';
                            for(var i=0;i<params.length;i++){
                                nameArr[i]=params[i].seriesName;
                                valueArr[i]=Number(params[i].data).toFixed(1);

                                str+= nameArr[i]+' : '+valueArr[i]+'<br/>'
                            }
                            return params[0].axisValueLabel+'<br/>'+str
                        }
                    },
                    color:['#00cdfd','#8806c5','#6925e5']
                },
                {
                    tooltip:{
                        show:true,
                        alwaysShowContent:false,
                        formatter:function(params){
                            var nameArr = [];
                            var valueArr = [];
                            var str = '';
                            for(var i=0;i<params.length;i++){
                                nameArr[i]=params[i].seriesName;
                                valueArr[i]=Number(params[i].data).toFixed(1);

                                str+= nameArr[i]+' : '+valueArr[i]+'<br/>'
                            }
                            return params[0].axisValueLabel+'<br/>'+str
                        }
                    },
                    legend:{
                        show:true,
                        textStyle:{
                            color:'#afeafb'
                        },
                        right:0,
                        data:[
                            {
                                name:'平均放散开度',
                                icon:'rect'
                            }]
                    },
                    grid:{
                        containLabel:true,
                        left:'5%',
                        top:50,
                        bottom:10,
                        right:40
                    },
                    yAxis:{
                        name:'',
                        axisLabel:{
                            formatter:function (value, index) {
                                return value;
                            }
                        },
                        nameTextStyle:{
                            color:'#b0e9fe',
                            fontSize:12,
                            align:'right',
                            padding:[3, 4, 5, 6]
                        },
                        axisLine:{
                            lineStyle:{
                                color:'#b0e9fe',

                            }
                        },
                        axisTick:{
                            inside:true
                        },
                        splitLine:{
                            show:false
                        }
                    },
                    xAxis:{
                        name:'',
                        nameTextStyle:{
                            color:'#b0e9fe',
                            fontSize:12,
                            align:'right',
                            padding:[1, 1, 5, 1]
                        },
                        axisLine:{
                            lineStyle:{
                                color:'#b0e9fe',

                            }
                        },
                        axisTick:{
                            show:false,
                            inside:false
                        }
                    },
                    color:['#00cdfd','#8806c5','#6925e5']
                },
                {
                    tooltip:{
                        show:true,
                        alwaysShowContent:false,
                        formatter:function(params){
                            var nameArr = [];
                            var valueArr = [];
                            var str = '';
                            for(var i=0;i<params.length;i++){
                                nameArr[i]=params[i].seriesName;
                                valueArr[i]=Number(params[i].data).toFixed(1);

                                str+= nameArr[i]+' : '+valueArr[i]+'<br/>'
                            }
                            return params[0].axisValueLabel+'<br/>'+str
                        }
                    },
                    legend:{
                        show:true,
                        textStyle:{
                            color:'#afeafb'
                        },
                        right:0,
                        data:[
                            {
                                name:'轧钢停线重叠率',
                                icon:'rect'
                            }]
                    },
                    grid:{
                        containLabel:true,
                        left:'5%',
                        top:50,
                        bottom:10,
                        right:40
                    },
                    yAxis:{
                        name:'(%)',
                        axisLabel:{
                            formatter:function (value, index) {
                                return value;
                            }
                        },
                        nameTextStyle:{
                            color:'#b0e9fe',
                            fontSize:12,
                            align:'right',
                            padding:[3, 4, 5, 6]
                        },
                        axisLine:{
                            lineStyle:{
                                color:'#b0e9fe',

                            }
                        },
                        axisTick:{
                            inside:true
                        },
                        splitLine:{
                            show:false
                        }
                    },
                    xAxis:{
                        name:'',
                        nameTextStyle:{
                            color:'#b0e9fe',
                            fontSize:12,
                            align:'right',
                            padding:[1, 1, 5, 1]
                        },
                        axisLine:{
                            lineStyle:{
                                color:'#b0e9fe',

                            }
                        },
                        axisTick:{
                            show:false,
                            inside:false
                        }
                    },
                    color:['#00cdfd','#8806c5','#6925e5']
                }

            ],
            chartAjaxData:[]

        },
        baseChart:{
            hisChart:[],
            chartName:[
                ['锅炉1','锅炉2','锅炉3','锅炉4','锅炉5','锅炉总产气量','锅炉6','锅炉7','锅炉8','锅炉9','锅炉10','锅炉总产气量']
            ],
            chartData:[
                [   {name:'实际3号TRT压力图',type:'line',lineStyle:'solid',color:'#01c5f7'},
                    {name:'压力上基线',type:'line',lineStyle:'solid', color:'#6822e4'},
                    {name:'压力下基线',type:'line',lineStyle:'solid', color:'#e8830d'}
                ],
                [
                    {name:'高炉1',type:'line',lineStyle:'solid',color:'#01c5f7',id:'锅炉1'},
                    {name:'高炉2',type:'line',lineStyle:'solid', color:'#8c04c6',id:'锅炉2'},
                    {name:'高炉3',type:'line',lineStyle:'solid', color:'#6822e4',id:'锅炉3'},
                    {name:'高炉4',type:'line',lineStyle:'solid', color:'#e8830d',id:'锅炉4'},
                    {name:'高炉5',type:'line',lineStyle:'solid', color:'#87c313',id:'锅炉5'},
                    {name:'高炉总产气量',type:'line',lineStyle:'solid', color:'#2e35e4',id:'锅炉总产气量'},
                    {name:'高炉预测1',type:'line',lineStyle:'dashed',color:'#01c5f7',id:'锅炉1预测'},
                    {name:'高炉预测2',type:'line',lineStyle:'dotted', color:'#8c04c6',id:'锅炉2预测'},
                    {name:'高炉预测3',type:'line',lineStyle:'dotted', color:'#6822e4',id:'锅炉3预测'},
                    {name:'高炉预测4',type:'line',lineStyle:'dotted', color:'#e8830d',id:'锅炉4预测'},
                    {name:'高炉预测5',type:'line',lineStyle:'dotted', color:'#87c313',id:'锅炉5预测'},
                    {name:'高炉预测总产气量',type:'line',lineStyle:'dotted', color:'#2e35e4',id:'锅炉总产气量预测'},
                    {name:'高炉总产气量上基线',type:'line',lineStyle:'dotted', color:'#2e35e4',id:'锅炉总产气量预测'},
                    {name:'高炉总产气量下基线',type:'line',lineStyle:'dotted', color:'#2e35e4',id:'锅炉总产气量预测'}
                ],
                [
                    {name:'热风炉1',type:'line',lineStyle:'solid',color:'#01c5f7'},
                    {name:'热风炉2',type:'line',lineStyle:'solid', color:'#8c04c6'},
                    {name:'热风炉3',type:'line',lineStyle:'solid', color:'#6822e4'},
                    {name:'热风炉4',type:'line',lineStyle:'solid', color:'#e8830d'},
                    {name:'热风炉5',type:'line',lineStyle:'solid', color:'#87c313'},
                    {name:'热风炉总用气',type:'line',lineStyle:'solid', color:'#2e35e4'},
                    {name:'热风炉总用气预测',type:'line',lineStyle:'solid', color:'#6822e4'},
                    {name:'热风炉总用气量上基线',type:'line',lineStyle:'dotted', color:'#01c5f7'},
                    {name:'热风炉总用气量下基线',type:'line',lineStyle:'dotted',color:'#01c5f7'}
                ],
                [
                    {name:'锅炉1',type:'line',lineStyle:'solid',color:'#01c5f7',id:'锅炉1'},
                    {name:'锅炉2',type:'line',lineStyle:'solid', color:'#8c04c6',id:'锅炉2'},
                    {name:'锅炉3',type:'line',lineStyle:'solid', color:'#6822e4',id:'锅炉3'},
                    {name:'锅炉4',type:'line',lineStyle:'solid', color:'#e8830d',id:'锅炉4'},
                    {name:'锅炉5',type:'line',lineStyle:'solid', color:'#87c313',id:'锅炉5'},
                    {name:'锅炉总用气量',type:'line',lineStyle:'solid', color:'#2e35e4',id:'锅炉总产气量'},
                    {name:'锅炉1建议',type:'line',lineStyle:'dashed',color:'#01c5f7',id:'锅炉1预测'},
                    {name:'锅炉2建议',type:'line',lineStyle:'dotted', color:'#8c04c6',id:'锅炉2预测'},
                    {name:'锅炉3建议',type:'line',lineStyle:'dotted', color:'#6822e4',id:'锅炉3预测'},
                    {name:'锅炉4建议',type:'line',lineStyle:'dotted', color:'#e8830d',id:'锅炉4预测'},
                    {name:'锅炉5建议',type:'line',lineStyle:'dotted', color:'#87c313',id:'锅炉5预测'},
                    {name:'锅炉总调节量',type:'line',lineStyle:'dotted', color:'#2e35e4',id:'锅炉总产气量预测'}
                ],
                [
                    {name:'轧钢1实际用气',type:'line',lineStyle:'solid',color:'#01c5f7'},
                    {name:'轧钢2实际用气',type:'line',lineStyle:'solid', color:'#8c04c6'},
                    {name:'轧钢3实际用气',type:'line',lineStyle:'solid', color:'#6822e4'},
                    {name:'轧钢4实际用气',type:'line',lineStyle:'solid', color:'#e8830d'},
                    {name:'轧钢5实际用气',type:'line',lineStyle:'solid', color:'#87c313'},
                    {name:'轧钢总用气量',type:'line',lineStyle:'solid', color:'#2e35e4'},
                    {name:'轧钢预计用气',type:'line',lineStyle:'dashed', color:'#01c5f7'},
                    {name:'轧钢总用气量上基线',type:'line',lineStyle:'solid', color:'#01c5f7'},
                    {name:'轧钢总用气量下基线',type:'line',lineStyle:'solid', color:'#01c5f7'}
                ]
                ],
            hisOption:[
                {
                    grid:{
                        show:false,
                        left:'6%',
                        top:'3%'
                    },
                    //backgroundColor:'',
                    tooltip:{
                        trigger: 'axis',
                        formatter:function(params){
                            var nameArr = [];
                            var valueArr = [];
                            var str = '';
                            for(var i=0;i<params.length;i++){
                                nameArr[i]=params[i].seriesName;
                                valueArr[i]=Number(params[i].data).toFixed(1);

                                str+= nameArr[i]+' : '+valueArr[i]+'<br/>'
                            }
                            return params[0].axisValueLabel+'<br/>'+str
                        }
                    },
                    legend:{
                        show:true,
                        textStyle:{
                            color:'#afeafb'
                        },
                        right:0,
                        data:[
                            {
                                name:'实际3号TRT压力图',
                                icon:'rect'
                            },{
                                name:'压力上基线',
                                icon:'rect'
                            },{
                                name:'压力下基线',
                                icon:'rect'
                            }
                        ]
                    },
                    yAxis:{
                        name:'KPa',
                        splitLine:{
                            show:true,
                            lineStyle:{
                                color:'#ccc',
                                type:'dashed'
                            }
                        }
                    },
                    xAxis:{
                        splitLine:{
                            show:true,
                            lineStyle:{
                                color:'#ccc',
                                type:'dashed'
                            }
                        }
                    },
                    color:['#01c5f7','#8c04c6','#6822e4','#e8830d','#2e35e4','#8c04c6','#6822e4','#e8830d','#2e35e4','#6822e4','#e8830d','#2e35e4']
                },
                {
                    grid:{
                        show:false,
                        left:'9%'
                    },
                   // backgroundColor:'#080c11',
                    tooltip:{
                        trigger: 'axis',
                        formatter:function(params){
                            var nameArr = [];
                            var valueArr = [];
                            var str = '';
                            for(var i=0;i<params.length;i++){
                                nameArr[i]=params[i].seriesName;
                                valueArr[i]=Number(params[i].data).toFixed(1);

                                str+= nameArr[i]+' : '+valueArr[i]+'<br/>'
                            }
                            return params[0].axisValueLabel+'<br/>'+str
                        }
                    },
                    legend:{
                        show:true,
                        textStyle:{
                            color:'#afeafb'
                        },
                        right:0,
                        data:[
                            {
                                name:'高炉1',
                                icon:'rect'
                            },{
                                name:'高炉2',
                                icon:'rect'
                            },{
                                name:'高炉3',
                                icon:'rect'
                            },{
                                name:'高炉4',
                                icon:'rect'
                            },{
                                name:'高炉5',
                                icon:'rect'
                            },{
                                name:'高炉总产气量',
                                icon:'rect'
                            },{
                                name:'高炉预测1',
                                icon:'rect'
                            },{
                                name:'高炉预测2',
                                icon:'rect'
                            },{
                                name:'高炉预测3',
                                icon:'rect'
                            },{
                                name:'高炉预测4',
                                icon:'rect'
                            },{
                                name:'高炉预测5',
                                icon:'rect'
                            },{
                                name:'高炉预测总产气量',
                                icon:'rect'
                            },{
                                name:'高炉总产气量上基线',
                                icon:'rect'
                            },{
                                name:'高炉总产气量下基线',
                                icon:'rect'
                            }
                        ]
                    },
                    yAxis:{
                        name:'m³/h',
                        splitLine:{
                            show:true,
                            lineStyle:{
                                color:'#ccc',
                                type:'dashed'
                            }
                        }
                    },
                    xAxis:{
                        splitLine:{
                            show:true,
                            lineStyle:{
                                color:'#ccc',
                                type:'dashed'
                            }
                        }
                    },
                    color:['#01c5f7','#8c04c6','#6822e4','#e8830d','#87c313','#2e35e4','#01c5f7','#8c04c6','#6822e4','#e8830d','#87c313','#2e35e4','#2e35e4','#2e35e4']
                },
                {
                    grid:{
                        show:false,
                        left:'8%'
                    },
                    tooltip:{
                        trigger: 'axis',
                        formatter:function(params){
                            var nameArr = [];
                            var valueArr = [];
                            var str = '';
                            for(var i=0;i<params.length;i++){
                                nameArr[i]=params[i].seriesName;
                                valueArr[i]=Number(params[i].data).toFixed(1);

                                str+= nameArr[i]+' : '+valueArr[i]+'<br/>'
                            }
                            return params[0].axisValueLabel+'<br/>'+str
                        }
                    },
                    legend:{
                        show:true,
                        textStyle:{
                            color:'#afeafb'
                        },
                        right:0,
                        data:[
                            {
                                name:'热风炉1',
                                icon:'rect'
                            },{
                                name:'热风炉2',
                                icon:'rect'
                            },{
                                name:'热风炉3',
                                icon:'rect'
                            },{
                                name:'热风炉4',
                                icon:'rect'
                            },{
                                name:'热风炉5',
                                icon:'rect'
                            },{
                                name:'热风炉总用气',
                                icon:'rect'
                            },{
                                name:'热风炉总用气预测',
                                icon:'rect'
                            },{
                                name:'热风炉总用气量上基线',
                                icon:'rect'
                            },{
                                name:'热风炉总用气量下基线',
                                icon:'rect'
                            }
                        ]
                    },
                    yAxis:{
                        name:'m³/h',
                        splitLine:{
                            show:true,
                            lineStyle:{
                                color:'#ccc',
                                type:'dashed'
                            }
                        }
                    },
                    xAxis:{
                        splitLine:{
                            show:true,
                            lineStyle:{
                                color:'#ccc',
                                type:'dashed'
                            }
                        }
                    },
                    color:['#01c5f7','#8c04c6','#6822e4','#e8830d','#87c313','#2e35e4','#6822e4','#01c5f7','#01c5f7']
                },
                {
                    grid:{
                        show:false,
                        left:'8%'
                    },
                    //backgroundColor:'rgba(9,73,109,1)',
                    tooltip:{
                        trigger: 'axis',
                        formatter:function(params){
                            var nameArr = [];
                            var valueArr = [];
                            var str = '';
                            for(var i=0;i<params.length;i++){
                                nameArr[i]=params[i].seriesName;
                                valueArr[i]=Number(params[i].data).toFixed(1);

                                str+= nameArr[i]+' : '+valueArr[i]+'<br/>'
                            }
                            return params[0].axisValueLabel+'<br/>'+str
                        }
                    },
                    legend:{
                        show:true,
                        textStyle:{
                            color:'#afeafb'
                        },
                        right:0,
                        data:[
                            {
                                name:'锅炉1',
                                icon:'rect'
                            },{
                                name:'锅炉2',
                                icon:'rect'
                            },{
                                name:'锅炉3',
                                icon:'rect'
                            },{
                                name:'锅炉4',
                                icon:'rect'
                            },{
                                name:'锅炉5',
                                icon:'rect'
                            },{
                                name:'锅炉总用气量',
                                icon:'rect'
                            },{
                                name:'锅炉1建议',
                                icon:'rect'
                            },{
                                name:'锅炉2建议',
                                icon:'rect'
                            },{
                                name:'锅炉3建议',
                                icon:'rect'
                            },{
                                name:'锅炉4建议',
                                icon:'rect'
                            },{
                                name:'锅炉5建议',
                                icon:'rect'
                            },{
                                name:'锅炉总调节量',
                                icon:'rect'
                            }
                        ]
                    },
                    yAxis:{
                        name:'m³/h',
                        splitLine:{
                            show:true,
                            lineStyle:{
                                color:'#ccc',
                                type:'dashed'
                            }
                        }
                    },
                    xAxis:{
                        splitLine:{
                            show:true,
                            lineStyle:{
                                color:'#ccc',
                                type:'dashed'
                            }
                        }
                    },
                    color:['#01c5f7','#8c04c6','#6822e4','#e8830d','#87c313','#2e35e4','#01c5f7','#8c04c6','#6822e4','#e8830d','#87c313','#2e35e4']
                },
                {
                    grid:{
                        show:false,
                        left:'8%'
                    },
                   // backgroundColor:'rgba(9,73,109,1)',
                    tooltip:{
                        trigger: 'axis',
                        formatter:function(params){
                            var nameArr = [];
                            var valueArr = [];
                            var str = '';
                            for(var i=0;i<params.length;i++){
                                nameArr[i]=params[i].seriesName;
                                valueArr[i]=Number(params[i].data).toFixed(1);

                                str+= nameArr[i]+' : '+valueArr[i]+'<br/>'
                            }
                            return params[0].axisValueLabel+'<br/>'+str
                        }
                    },
                    legend:{
                        show:true,
                        textStyle:{
                            color:'#afeafb'
                        },
                        right:0,
                        data:[
                            {
                                name:'轧钢1实际用气',
                                icon:'rect'
                            },{
                                name:'轧钢2实际用气',
                                icon:'rect'
                            },{
                                name:'轧钢3实际用气',
                                icon:'rect'
                            },{
                                name:'轧钢4实际用气',
                                icon:'rect'
                            },{
                                name:'轧钢5实际用气',
                                icon:'rect'
                            },
                            {
                                name:'轧钢总用气量',
                                icon:'rect'
                            },
                            {
                                name:'轧钢预计用气',
                                icon:'rect'
                            },{
                                name:'轧钢总用气量上基线',
                                icon:'rect'
                            },{
                                name:'轧钢总用气量下基线',
                                icon:'rect'
                            }
                        ]
                    },
                    yAxis:{
                        name:'m³/h',
                        splitLine:{
                            show:true,
                            lineStyle:{
                                color:'#ccc',
                                type:'dashed'
                            }
                        }
                    },
                    xAxis:{
                        splitLine:{
                            show:true,
                            lineStyle:{
                                color:'#ccc',
                                type:'dashed'
                            }
                        }
                    },
                    color:['#01c5f7','#8c04c6','#6822e4','#e8830d','#87c313','#2e35e4','#01c5f7','#01c5f7','#01c5f7','#6822e4','#e8830d','#2e35e4']
                }
            ]
        },
        linkList:[
            {link:'gaolu.html',title:'高炉'},
            {link:'hotwind.html',title:'热风炉'},
            {link:'zhagang.html',title:'轧钢'},
            {link:'guolu.html',title:'锅炉'},
            {link:'dongdiao.html',title:'动调'},
            {link:'other.html',title:'其他部门'}
        ],
        isOpen:false,
        timeStamp:0,
        bOk:false,
        isbOk:false,
        cityList: [
            {
                value: '1',
                label: '1'
            },
            {
                value: '2',
                label: '2'
            },
            {
                value: '3',
                label: '3'
            },
            {
                value: '4',
                label: '4'
            },
            {
                value: '5',
                label: '5'
            }
        ],
        boilernames:['高 炉 基 线','热风炉基线','轧 钢 基 线','其 他 基 线'],
        setData:{
            department:[
                {
                    type:'gaolu',
                    maxVal:'',
                    minVal:'2'
                },{
                    type:'refenglu',
                    maxVal:'678',
                    minVal:'2'
                },{
                    type:'zhagang',
                    maxVal:'',
                    minVal:'2'
                },{
                    type:'other',
                    maxVal:'',
                    minVal:'2'
                }
            ],
            shunxu:{
                value1: '3',
                value2: '4',
                value3: '5',
                value4: '2',
                value5: '1'
            },
            tiaojie:{
                value1: '调节1',
                value2: '2',
                value3: '3',
                value4: '4',
                value5: '5'
            },
            yali:{
                maxVal:'1',
                minVal:'2'
            },
            idealyali:{
                maxVal:'1',
                minVal:'2'
            },
            gas_upper_limit:{
                value1: '3',
                value2: '4',
                value3: '5',
                value4: '2',
                value5: '1'
            },
            gas_lower_limit:{
                value1: '3',
                value2: '4',
                value3: '5',
                value4: '2',
                value5: '1'
            },
            steam_upper_limit:{
                value1: '3',
                value2: '4',
                value3: '5',
                value4: '2',
                value5: '1'
            },
            steam_lower_limit:{
                value1: '3',
                value2: '4',
                value3: '5',
                value4: '2',
                value5: '1'
            },
            steam_upper_eco:{
                value1: '3',
                value2: '4',
                value3: '5',
                value4: '2',
                value5: '1'
            },
            steam_lower_eco:{
                value1: '3',
                value2: '4',
                value3: '5',
                value4: '2',
                value5: '1'
            },
            gas_threshold_hunshao:{
                value1: '3',
                value2: '4',
                value3: '5',
                value4: '2',
                value5: '1'
            },
            online_threshold:{
                value1: '3',
                value2: '4',
                value3: '5',
                value4: '2',
                value5: '1'
            },
            wait_time:{
                value1:'2'
            }

        },
        boilerName:'',
        username:'',
        admin_guolu:true,
        value1:'',
        value2:'',
        asBok:true,
        analysisList:[
            {link:'analysis_hotwind.html',title:'煤气用量'},
            {link:'analysis_zhagang.html',title:'轧钢质量'}
        ],
        museOpen:false

    },
    mounted:function(){
        var _this=this;
        this.$nextTick(function(){
            _this.getTimeStamp();
            _this.getName();
            setTimeout(function(){
                _this.getTimeStamp();
                _this.initChart();
                _this.sureAll();
                _this.sure('hotwind');
                _this.sure('operation');
                _this.sure('cuofeng');
                _this.sure('shaolu');
                _this.sure('zhagang');
                //_this.viewChart.chartArr[0].loadData();
            },2000);
        })
    },
    methods:{
        getTimeStamp:function(){
            var _this=this;
            var success=function(res){
                _this.timeStamp=res.data.time;
                //console.log(res.data);
                _this.sectionTime=getSectionTime(_this.timeStamp,7);
                _this.sectionTimeBoiler=getSectionTime(_this.timeStamp,1);
            };
            var error=function(e){
                console.log('加载时间戳出错了');
            };
            this.$http.get(URL+'/time/getTime').then(success,error);
        },
        getName:function(){
            var _this=this;
            var success=function(res){
                _this.username=res.data.username;
                _this.admin_guolu=res.data.admin_guolu
                //console.log(res.data);
            };
            var error=function(e){
                console.log('加载用户名出错了');
            };
            this.$http.get(URL+'/system/getuserinfo').then(success,error);
        },
        initChart:function(){
            var _this=this;
            //右侧
            //热风炉波动归因
            //主管压力超限分析
            this.viewChart.chartArr[0]=new Chart(this.viewChart.chartId[0],{
                data:_this.viewChart.chartData[0],
                baseOption:_this.viewChart.chartOption[0]
            });
            //操作统计
            //高炉减休风率
            this.viewChart.chartArr[1]=new Chart(this.viewChart.chartId[1],{
                data:_this.viewChart.chartData[1],
                baseOption:_this.viewChart.chartOption[1]
            });
            //错峰波动
            //热风炉错峰率
            this.viewChart.chartArr[2]=new Chart(this.viewChart.chartId[2],{
                data:_this.viewChart.chartData[2],
                baseOption:_this.viewChart.chartOption[2]
            });
            //烧炉波动
            //平均放散开度
            this.viewChart.chartArr[3]=new Chart(this.viewChart.chartId[3],{
                data:_this.viewChart.chartData[3],
                baseOption:_this.viewChart.chartOption[3]
            });
            //zhagangtingxian
            this.viewChart.chartArr[4]=new Chart(this.viewChart.chartId[4],{
                data:_this.viewChart.chartData[4],
                baseOption:_this.viewChart.chartOption[4]
            });
        },
        sure:function(name){

            var _this=this;
            var success=function(res){
                var data=res.data;
                if(data.length==0)return;
                _this.getData(name,data);
            };
            var error=function(e){
                console.log('加载'+name+'出错了');
            };
            this.$http.get(_this.getUrl(name),{start:_this.sectionTime.start,end:_this.sectionTime.end}).then(success,error);
        },
        sureAll:function(){
            var _this=this;
            if(_this.sectionTime.start > _this.sectionTime.end){
                alert('结束时间不能小于开始时间');
                return;
            }
            _this.sure('hotwind');
            _this.sure('operation');
            _this.sure('cuofeng');
            _this.sure('shaolu');
            _this.sure('zhagang');
        },
        getUrl:function(name){
            var url='';
            if(name=='hotwind'){
                url=URL+'/youhuafenxi/yalichaoxian';
            }else if(name=='operation'){
                url=URL+'/youhuafenxi/gaolujianxiufeng';
            }else if(name=='cuofeng'){
                url=URL+'/youhuafenxi/cuofengbodong';
            }else if(name=='shaolu'){
                 url=URL+'/youhuafenxi/fangsankaidu';
            }else if(name=='zhagang'){
                 url = URL+'/youhuafenxi/ZGTXchongdielv';
            }

            return url;
        },
        getData:function(name,data){
            var axis=[];
            var _this=this;
            if(Object.keys(data).length==0)return;
            switch(name){
                case 'hotwind':
                    /*_this.viewChart.chartArr[0].loadX(barName);
                     for(var i=0;i<barName.length;i++){

                     _this.viewChart.chartArr[0].loadData(barName[i],data[i]);
                     }*/
                    for(var i=0;i<data.length;i++){
                        axis[i]=getAxis(data[i]);
                        _this.viewChart.chartArr[0].loadX(axis[0].dataX,'mdhm');
                        _this.viewChart.chartArr[0].loadData(_this.viewChart.chartData[0][i].name,axis[i].dataY);
                    }

                    break;
                case 'operation':
                    for(var i=0;i<data.length;i++){
                        axis[i]=getAxis(data[i]);
                        _this.viewChart.chartArr[1].loadX(axis[0].dataX,'mdhm');
                        _this.viewChart.chartArr[1].loadData(_this.viewChart.chartData[1][i].name,axis[i].dataY);
                    }
                    break;
                case 'cuofeng':
                    //data=Object.values(data);
                    var chartName=_this.viewChart.chartName[2];
                    for(var i=0;i<chartName.length;i++){
                        axis[i]=getAxis(data[chartName[i]]);
                        _this.viewChart.chartArr[2].loadX(axis[0].dataX,'mdhm');
                        _this.viewChart.chartArr[2].loadData(_this.viewChart.chartData[2][i].name,axis[i].dataY);
                    }
                    break;
                case 'shaolu':
                    var chartName=_this.viewChart.chartName[3];
                    for(var i=0;i<chartName.length;i++){
                        axis[i]=getAxis(data[chartName[i]]);
                        _this.viewChart.chartArr[3].loadX(axis[0].dataX,'mdhm');
                        _this.viewChart.chartArr[3].loadData(_this.viewChart.chartData[3][i].name,axis[i].dataY);
                    }
                    break;
                case 'zhagang':
                    for(var i=0;i<data.length;i++){
                        axis[i]=getAxis(data[i]);
                        _this.viewChart.chartArr[4].loadX(axis[0].dataX,'mdhm');
                        _this.viewChart.chartArr[4].loadData(_this.viewChart.chartData[4][i].name,axis[i].dataY);
                    }
                    break;
                default:
                    console.log(name+'值有误')
                    break;
            }
        },
        datePicker:function(Val){
            var _this=this;
            laydate({
                istime: true,
                format:'YYYY-MM-DD hh:mm',
                choose:function(dates){ //选择好日期的回调
                    //_this.valStart = dates;
                    var oldTime = (new Date(dates)).getTime();
                    if(Val=='valStart'){
                        _this.sectionTime.start = oldTime
                    }else if(Val=='valEnd'){
                        _this.sectionTime.end = oldTime
                    }
                }
            })
        },
        close:function(val){
            var _this = this;
            if(val=='false'){
                _this.bOk  = false;
            }else if(val=='true'){
                _this.bOk = true;
                var success = function(res){
                    _this.setData = res.data
                };
                var error = function(e){
                    console.log(e)
                }
                this.$http.get(URL+'/youhuafenxi/getparams').then(success,error);

            }
        },
        dEpartment:function(){
            var success = function(res){
                console.log('成功')
            };
            var error =function(e){
                console.log(e)
            }
            this.$http.post(URL+'/youhuafenxi/setbaseline',{
                    data:this.setData.department
            }).then(success,error);
        },
        guoluDepartment:function(){
            this.$http.post(URL+'/youhuafenxi/setguoluparam',{
                    shunxu:this.setData.shunxu,
                    tiaojie:this.setData.tiaojie,
                    yali:this.setData.yali,
                    idealyali:this.setData.idealyali,
                    gas_upper_limit:this.setData.gas_upper_limit,
                    gas_lower_limit:this.setData.gas_lower_limit,
                    steam_upper_limit:this.setData.steam_upper_limit,
                    steam_lower_limit:this.setData.steam_lower_limit,
                    steam_upper_eco:this.setData.steam_upper_eco,
                    steam_lower_eco:this.setData.steam_lower_eco,
                    gas_threshold_hunshao:this.setData.gas_threshold_hunshao,
                    online_threshold:this.setData.online_threshold,
                    wait_time:this.setData.wait_time

            });
        },
        closeChart:function(val,name){
            var _this = this;
            if(val=='false'){
                _this.isbOk = false;
            }else if(val=='true'){
                _this.isbOk = true;
                _this.boilerName = name;
                _this.inithistory(_this.boilerName);
                _this.getHistoryurl(_this.boilerName)
            }
        },
        inithistory:function(name){
            var _this = this;
            switch (name) {
                case 'trt3pressure':
                    _this.baseChart.hisChart[0] = new Chart('chartapp', {
                        data: _this.baseChart.chartData[0],
                        baseOption: _this.baseChart.hisOption[0],
                    });
                    break;

                case 'gaolu':
                    _this.baseChart.hisChart[1] = new Chart('chartapp', {
                        data: _this.baseChart.chartData[1],
                        baseOption: _this.baseChart.hisOption[1],
                    });
                    break;
                case 'hotwind':
                    _this.baseChart.hisChart[2] = new Chart('chartapp', {
                        data: _this.baseChart.chartData[2],
                        baseOption: _this.baseChart.hisOption[2],
                    });
                    break;
                case 'guolu':
                _this.baseChart.hisChart[3] = new Chart('chartapp', {
                    data: _this.baseChart.chartData[3],
                    baseOption: _this.baseChart.hisOption[3],
                });
                break;
                case 'zhagang':
                    _this.baseChart.hisChart[4] = new Chart('chartapp', {
                        data: _this.baseChart.chartData[4],
                        baseOption: _this.baseChart.hisOption[4],
                    });
                    break;
            }

        },
        handleChange:function(date){
            this.date.data1= new Date(date.replace(/-/g, '/'));
            this.sectionTimeBoiler.start = this.date.data1.getTime();
        },
        handleChange1:function(date){
            this.date.data2= new Date(date.replace(/-/g, '/'));
            this.sectionTimeBoiler.end = this.date.data2.getTime();

        },
        getHistotyDataurl:function(name,data){
            var _this = this;
                var axis=[];
                var _this=this;
                if(Object.keys(data).length==0)return;
                switch(name){
                    case 'trt3pressure':
                        for(var i=0;i<data.length;i++){
                            axis[i]=getAxis(data[i]);
                            _this.baseChart.hisChart[0].loadX(axis[0].dataX,'mdhm');
                            _this.baseChart.hisChart[0].loadData(_this.baseChart.chartData[0][i].name,axis[i].dataY);
                        }
                        break;
                    case 'gaolu':
                        for(var i=0;i<data.length;i++){
                            axis[i]=getAxis(data[i]);
                            _this.baseChart.hisChart[1].loadX(axis[0].dataX,'mdhm');
                            _this.baseChart.hisChart[1].loadData(_this.baseChart.chartData[1][i].name,axis[i].dataY);
                        }
                        break;
                    case 'hotwind':
                        for(var i=0;i<data.length;i++){
                            axis[i]=getAxis(data[i]);
                            _this.baseChart.hisChart[2].loadX(axis[0].dataX,'mdhm');
                            _this.baseChart.hisChart[2].loadData(_this.baseChart.chartData[2][i].name,axis[i].dataY);
                        }
                        break;
                    case 'guolu':
                        for(var i=0;i<data.length;i++){
                            axis[i]=getAxis(data[i]);
                            _this.baseChart.hisChart[3].loadX(axis[0].dataX,'mdhm');
                            _this.baseChart.hisChart[3].loadData(_this.baseChart.chartData[3][i].name,axis[i].dataY);
                        }
                        break;
                    case 'zhagang':
                        for(var i=0;i<data.length;i++){
                            axis[i]=getAxis(data[i]);
                            _this.baseChart.hisChart[4].loadX(axis[0].dataX,'mdhm');
                            _this.baseChart.hisChart[4].loadData(_this.baseChart.chartData[4][i].name,axis[i].dataY);
                        }
                        break;
                }
        },
        getHistoryurl:function(name){
            var _this = this;
            var success = function (res){
                var data = res.data;
                _this.getHistotyDataurl(name,data)
            };
            var error = function(e){
                console.log(name+'加载出错')
            };
            this.$http.get(URL+'/youhuafenxi/'+name,{start:_this.sectionTimeBoiler.start,end:_this.sectionTimeBoiler.end}).then(success,error)
        },
        historySur:function(){
            var _this = this;
            _this.inithistory(_this.boilerName);
            _this.getHistoryurl(_this.boilerName)
        },
        choseBok:function(val){
            this.asBok = val
        }
    }
});